/*
 *  Copyright (C) 2010 Glauco
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.balisunrise.common.abstracts;

import java.io.Serializable;
import org.balisunrise.annotation.PanelType;

/**
 *
 * @author Glauco
 */
public abstract class AbstractEntityPanel extends AbstractLayoutable{

    protected Serializable entity;
    protected PanelType type;
    public static final String PROP_ENTITY = "entity";
    public static final String PROP_TYPE = "type";

    /**
     * Get the value of type
     *
     * @return the value of type
     */
    public PanelType getType() {
        return type;
    }

    /**
     * Set the value of type
     *
     * @param type new value of type
     */
    public void setType(PanelType type) {
        PanelType oldType = this.type;
        this.type = type;
        changeSupport.firePropertyChange(PROP_TYPE, oldType, type);
    }

    /**
     * Get the value of entity
     *
     * @return the value of entity
     */
    public Serializable getEntity() {
        return entity;
    }

    /**
     * Set the value of entity
     *
     * @param entity new value of entity
     */
    public void setEntity(Serializable entity) {
        Serializable oldEntity = this.entity;
        this.entity = entity;
        changeSupport.firePropertyChange(PROP_ENTITY, oldEntity, entity);
    }

}
